<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}交易监控系统{% endblock %}</title>
    <link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <link rel="icon" href="{{ url_for('static', path='img/favicon.ico') }}" type="image/x-icon">
    <link rel="shortcut icon" href="{{ url_for('static', path='img/favicon.ico') }}" type="image/x-icon">
    {% block extra_css %}{% endblock %}
    {% block head_extra %}{% endblock %}
    
</head>
<body>
    <div class="container">
        <!-- 侧边栏 -->
        {% if request.user %}
        <div class="sidebar">
        {% endif %}
          <div class="sidebar-header">
                <h2>交易监控系统</h2>
                
            </div>
            <ul class="sidebar-menu">
                <li>
                    <a href="/" class="{{ 'active' if request.url.path == '/' else '' }}">
                        <i class="fas fa-home"></i>
                        <span>首页</span>
                    </a>
                </li>
                <li>
                    <a href="/products" class="{{ 'active' if request.url.path == '/products' else '' }}">
                        <i class="fas fa-box"></i>
                        <span>品种管理</span>
                    </a>
                </li>
                <li>
                    <a href="/monitored_products" class="{{ 'active' if request.url.path == '/monitored_products' else '' }}">
                        <i class="fas fa-eye"></i>
                        <span>监控中品种</span>
                    </a>
                </li>
                <li>
                    <a href="/config" class="{{ 'active' if request.url.path == '/config' else '' }}">
                        <i class="fas fa-cog"></i>
                        <span>交易监控系统配置</span>
                    </a>
                </li>
                <li>
                    <a href="/trade_records" class="{{ 'active' if request.url.path == '/trade_records' else '' }}">
                        <i class="fas fa-chart-line"></i>
                        <span>交易记录</span>
                    </a>
                </li>
                <li>
                    {% if request.state.user_type in ['super_admin', 'admin'] %}
                    <a href="/database_config" class="{{ 'active' if request.url.path == '/database_config' else '' }}">
                        <i class="fas fa-database"></i>
                        <span>数据库配置</span>
                    </a>
                    {% endif %}
                    <a href="/user/settings" class="{{ 'active' if request.url.path == '/user/settings' else '' }}">
                        <i class="fas fa-user-cog"></i>
                        <span>用户设置</span>
                    </a>
                </li>
            </ul>
            <ul class="sidebar-menu">
                {% if request.state.user_type in ['super_admin', 'admin'] %}
                <li>
                    <a href="/admin/users" class="{{ 'active' if request.url.path == '/admin/users' else '' }}">
                        <i class="fas fa-users-cog"></i>
                        <span>用户管理</span>
                    </a>
                </li>
                {% endif %}
                <li>
                    <a href="/help" class="{{ 'active' if request.url.path == '/help' else '' }}">
                        <i class="fas fa-question-circle"></i>
                        <span>帮助中心</span>
                    </a>
                </li>
                <li>
                    <a href="/logout">
                        <i class="fas fa-sign-out-alt"></i>
                        <span>退出登录</span>
                    </a>
                </li>
            </ul>
        </div>

        <!-- 主内容区域 -->
        <div class="main-content">
            {% block content %}{% endblock %}
        </div>
    </div>

    
    </script>
    {% block extra_js %}{% endblock %}
</body>
</html>